{% extends "base.html" %}

{% block content %}
<div class="row fade-in">
    <div class="col-lg-12 mb-4">
        <div class="card shadow-sm">
            <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                <h4 class="m-0 font-weight-bold text-primary"><i class="bi bi-speedometer2 me-2"></i>仪表盘</h4>
            </div>
            <div class="card-body">
                <div class="text-center mb-4">
                    <img src="https://ui-avatars.com/api/?name={{ current_user.username }}&background=4e73df&color=fff&size=128" 
                         class="rounded-circle shadow-sm mb-3" alt="用户头像">
                    <h3 class="font-weight-bold">欢迎回来, {{ current_user.username }}!</h3>
                    <p class="text-muted">这是您的个人仪表盘页面</p>
                </div>
                
                {% if current_user.is_admin %}
                <div class="alert alert-primary d-flex align-items-center" role="alert">
                    <i class="bi bi-star-fill me-2"></i>
                    <div>
                        您拥有管理员权限，可以访问<a href="{{ url_for('admin.user_management') }}" class="alert-link">用户管理</a>页面。
                    </div>
                </div>
                {% endif %}
                
                <div class="row mt-4">
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card dashboard-widget h-100 py-2">
                            <div class="card-body">
                                <div class="row no-gutters align-items-center">
                                    <div class="col mr-2">
                                        <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
                                            登录次数</div>
                                        <div class="h5 mb-0 font-weight-bold text-gray-800">12</div>
                                    </div>
                                    <div class="col-auto">
                                        <i class="bi bi-door-open fs-1 text-primary"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card dashboard-widget success h-100 py-2">
                            <div class="card-body">
                                <div class="row no-gutters align-items-center">
                                    <div class="col mr-2">
                                        <div class="text-xs font-weight-bold text-success text-uppercase mb-1">
                                            注册天数</div>
                                        <div class="h5 mb-0 font-weight-bold text-gray-800">15</div>
                                    </div>
                                    <div class="col-auto">
                                        <i class="bi bi-calendar-check fs-1 text-success"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card dashboard-widget h-100 py-2">
                            <div class="card-body">
                                <div class="row no-gutters align-items-center">
                                    <div class="col mr-2">
                                        <div class="text-xs font-weight-bold text-info text-uppercase mb-1">
                                            消息</div>
                                        <div class="h5 mb-0 font-weight-bold text-gray-800">3</div>
                                    </div>
                                    <div class="col-auto">
                                        <i class="bi bi-envelope fs-1 text-info"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-xl-3 col-md-6 mb-4">
                        <div class="card dashboard-widget warning h-100 py-2">
                            <div class="card-body">
                                <div class="row no-gutters align-items-center">
                                    <div class="col mr-2">
                                        <div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
                                            待办事项</div>
                                        <div class="h5 mb-0 font-weight-bold text-gray-800">5</div>
                                    </div>
                                    <div class="col-auto">
                                        <i class="bi bi-list-check fs-1 text-warning"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}